package top.hzy520.user.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import top.hzy520.dept.entity.Dept;
import top.hzy520.user.dto.SearchUserDto;
import top.hzy520.user.entity.User;

import java.util.List;

@Mapper
public interface UserMapper {
    int deleteByPrimaryKey(Long id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    User selectByUserName(String username);

    List<User> selectAllUser(@Param("offset") int offset, @Param("limit") int limit);

    int selectAllcount();

    List<User> selectAllUserById(@Param("offset") int offset,@Param("limit") int limit,@Param("id") Long id);

    int selectAllcountBy(Long id);

    void deleteAllUser(@Param("userList") List<User> userList);

    List<User> selectUserBySearch(SearchUserDto searchUserDto);

    int selectCountBySearch(SearchUserDto searchUserDto);

    List<User> selectUserByDeptList(@Param("offset") int offset, @Param("limit") int limit, @Param("deptList") List<Dept> deptList);

    int selectCountByListDeptId(@Param("deptList") List<Dept> deptList);

    User selectByUserId(Long id);
}